package com.itheima.springbootwebtlias.controller;

import com.itheima.springbootwebtlias.pojo.PageResult;
import com.itheima.springbootwebtlias.pojo.Result;
import com.itheima.springbootwebtlias.service.LogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/log")
public class LogController {

    @Autowired
    private LogService logService;

    // 分页查询
    @GetMapping("/page")
    public Result page(@RequestParam Integer page, @RequestParam Integer pageSize) {
        log.info("分页查询");
        PageResult pageResult = logService.page(page, pageSize);
        return Result.success(pageResult);
    }
}
